import java.util.Scanner;

/**
   Counts the number of words in a line.
   Input: a string containing the line
   Output: the number of words in the line
*/
public class CountWords
{
   public static void main(String[] args)
   {
      // your work here
      int count = 0;
      int sum = 0;
      Scanner in = new Scanner(System.in);
      while (in.hasNext())
      {
         String a = in.nextLine();
         for(int i = 0; i < a.length(); i++)
         {
            char c = a.charAt(i);
            String b = c + "";
            if(b.equals(" "))
            {
               sum++;
            }
         }
      }
      count = sum + 1;
      // more work here

      System.out.println(count);
   }
}